package com.bingwang.sourcelearn.aop;

import com.bingwang.sourcelearn.aop.interceptor.CglibInterceptor;
import com.bingwang.sourcelearn.aop.service.InvokeClient;
import org.springframework.cglib.proxy.Enhancer;

/**
 * @author WangBing
 * @date 2023/11/19 12:13
 */
public class CglibProxyTestMain {
    public static void main(String[] args) {
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(InvokeClient.class);
        enhancer.setCallback(new CglibInterceptor());
        InvokeClient invokeClient = (InvokeClient) enhancer.create();
        invokeClient.invokeRemote();
    }
}
